import { createRouter, createWebHashHistory } from 'vue-router'
const routes = [
  {
    path: '/',
    name: 'layout',
    component:  () => import('@/Layout/index.vue'),
      redirect: '/device',
    children: [
        {
            path: '/device',
            name: 'device',
            component:  () => import('@/views/device/index.vue'),
        },
        {
            path: '/device/save/:id?',
            name: 'deviceSave',
            component:  () => import('@/views/device/save.vue'),
        },
        {
            path: '/deviceData',
            name: 'deviceData',
            component:  () => import('@/views/deviceData/index.vue'),
        },
        {
            path: '/deviceData/save/:id?',
            name: 'deviceDataSave',
            component:  () => import('@/views/deviceData/save.vue'),
        },
        {
            path: '/member',
            name: 'member',
            component:  () => import('@/views/member/index.vue'),
        },
        {
            path: '/member/save/:id?',
            name: 'memberSave',
            component:  () => import('@/views/member/save.vue'),
        },

        {
            path: '/consult',
            name: 'consult',
            component:  () => import('@/views/consult/index.vue'),
        },
        {
            path: '/consult/save/:id?',
            name: 'consultSave',
            component:  () => import('@/views/consult/save.vue'),
        },

        {
            path: '/news',
            name: 'news',
            component:  () => import('@/views/news/index.vue'),
        },
        {
            path: '/news/Save/:id?',
            name: 'newsSave',
            component:  () => import('@/views/news/save.vue'),
        },
    ]
  },
    {
        path: '/login',
        name: 'login',
        component:  () => import('@/views/Login.vue'),
    }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
